import '../../util/_base_export.dart';
import '../../util/_view_export.dart';

import '../../blocs/code.dart';
import '../../blocs/cart.dart';
import '../../util/app_util.dart';

class AccountMsgPage extends StatefulWidget {
  // final String iv_date;
  // final String iv_subject;
  // final String iv_content;
  const AccountMsgPage({
    // this.iv_date,
    // this.iv_subject,
    // this.iv_content,
    Key? key,
  }) : super(key: key);
  @override
  _AccountMsgPageState createState() => _AccountMsgPageState();
}

class _AccountMsgPageState extends State<AccountMsgPage> {
  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance?.addPostFrameCallback((callback) {});
  }

  List<Widget> list = List<Widget>.empty(growable :true);

  @override
  Widget build(BuildContext context) {
    // print(widget.iv_date);

    return Scaffold(
      appBar: AppBar(
        brightness: Brightness.light,
        leading: GestureDetector(
          behavior: HitTestBehavior.opaque,
          onTap: () {
            Navigator.pop(context);
          },
          child: Container(
            child: Icon(
              Icons.chevron_left,
              color: AppColor.blackMain,
              size: 32,
            ),
          ),
        ),
        title: Text(
          '',
          style: TextStyle(color: AppColor.blackMain),
        ),
      ),
      body: SingleChildScrollView(
        child: Container(
          color: Colors.grey[50],
          margin: EdgeInsets.only(top: 20.h),
          child: _bodyBlock(context),
        ),
      ),
    );
  }

  Widget _bodyBlock(BuildContext context) {
    return Padding(
      padding: EdgeInsets.symmetric(horizontal: 30.w),
      child: Column(children: <Widget>[
        Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Padding(
              padding: EdgeInsets.symmetric(vertical: 20.h),
              child: Text(
                AppSession.msgPage['date'] ?? '',
                style: AppTextStyle.dateMsg,
              ),
            ),
            Padding(
              padding: EdgeInsets.symmetric(vertical: 10.h),
              child: Text(
                AppSession.msgPage['subject'] ?? '',
                style: AppTextStyle.subjectMsg,
              ),
            ),
            Padding(
              padding: EdgeInsets.symmetric(vertical: 20.h),
              child: Text(
                AppSession.msgPage['content'] ?? '',
                style: AppTextStyle.contentMsg,
              ),
            ),
          ],
        ),
      ]),
    );
  }
}
